package chapter8;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/3/8 15:44
 */
class Glypy {
    public Glypy() {
        System.out.println("Glyph() before draw");
        draw();
        System.out.println("Glyph() after draw");
    }

    void draw() {
        System.out.println("Glypy.draw");
    }
}

class RoundGlypy extends Glypy {
    private int radius = 1;

    public RoundGlypy(int radius) {
        this.radius = radius;
        System.out.println("RoundGlypy.RoundGlyph(), radius = " + this.radius);
    }

    @Override
    void draw() {
        System.out.println("RoundGlyph.draw(), radius = " + radius);
    }
}

public class PolyConstructors {
    public static void main(String[] args) {
        new RoundGlypy(5);
    }
}
